

var app = getApp();
Page({
  data: {
    type:''
  },

  onLoad: function (o) {
    this.setData({
      type:o.type
    })
  },


  _login(e) {
    var t = this
    wx.showLoading({
      title: '处理中......'
    })
    setTimeout(function () {
      wx.hideLoading()
      app.globalData.header = e.detail.userInfo.avatarUrl;
      app.globalData.nickName = e.detail.userInfo.nickName;
      wx.showToast({
        title: '登陆成功',
        icon: 'success',
        duration: 1000,
        success: function () {
          setTimeout(function () {
            switch(t.data.type){
              case 1: case '1': var url = '/pages/mt_fillPit_roomCreate/mt_fillPit_roomCreate'; break;
              case 2: case '2': var url = '/pages/mt_fillPit_room/mt_fillPit_room';break;

              default:
                var url = '/pages/index/index';
            }
            wx.redirectTo({
              url: url,
            })
          }, 1000)
        }
      })
    }, 1000);
  },


})